package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.DictionaryItem;
import cn.wolfcode.crm.mapper.DictionaryItemMapper;
import cn.wolfcode.crm.service.IDictionaryItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryItemServiceImpl implements IDictionaryItemService {
    @Autowired
    private DictionaryItemMapper dictionaryItemMapper;


    public void insert(DictionaryItem record) {
        dictionaryItemMapper.insert(record);
    }

    public void updateByPrimaryKey(DictionaryItem record) {
        dictionaryItemMapper.updateByPrimaryKey(record);
    }

    public List<DictionaryItem> selectAll() {
        return dictionaryItemMapper.selectAll();
    }

    public void deleteByPrimaryKey(Long id) {
        dictionaryItemMapper.deleteByPrimaryKey(id);
    }


    public List<DictionaryItem> getItemBySn(String sn) {
        List<DictionaryItem> items = dictionaryItemMapper.getItemBySn(sn);
        return items;
    }

    public List<DictionaryItem> getItemByDictionaryId(String dictionaryId) {
        return dictionaryItemMapper.getItemByDictionaryId(dictionaryId);
    }

}
